<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>javascript</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box
    }
    body {
      font-size: 14px;
      padding: 20px;
    }
    ul li {
      line-height: 30px;
    }
  </style>
</head>
<body>
  <ul>
    <li>0</li>
  </ul>
  <button id="btn">add</button>
</body>
<script src="https://cdn.bootcss.com/vue/2.6.8/vue.js"></script>
<script>
    var btn = document.querySelector('#btn')
    var liDom = document.querySelector('li')
    function jieliu(handler, time) {
        var lastTime = 0;
        return function() {
            var nowTime = new Date().getTime()
            if (nowTime - lastTime >= time) {
                handler()
                lastTime = nowTime
            }
        }
    }
    function add() {
        liDom.innerText = parseInt(liDom.innerText) + 1
    }
    btn.onclick = jieliu(add, 2000)
</script>
</html>